from flask import Blueprint,Flask, send_file, request

download_bp = Blueprint('download', __name__)



@download_bp.route('/get-attachment', methods=['GET'])
def get_attachment() -> str:
    filename = request.args.get('filepath')
    try:
        # 发送文件给客户端
        return send_file(filename, as_attachment=True)
    except Exception as e:
        return str(e)


